#coding=utf-8

require "aio/core"

class Aio::Module::Cmd::Maipu::ShowEnv < Aio::Module::Cmd::Maipu
	include Aio::Module

	def initialize
		super({
			:cmd_full		=> "show environment",
			:cmd_short	=> "sh env",
			:author			=> "Elin",
			:description	=> "This is Maipu Command# show environment",
			:ranking		=> Ranking_1,
			:platform		=> "all",
			:benchmark	=> {
				:cpu_temperature 				=> ["<", 70],
				:mainboard_temperature 	=> ["<", 70],
				}
		})
	end

	def parse
		cont = self.context.dup
		env = {}
		useful[:env] = env
		context.readline_match_block(/CPU Temperature is (?<cpu_temperature>\d+)/) do |block|
			block.warning_serious(env, :cpu_temperature, self)
		end
		context.readline_match_block(/MainBoard Temperature is (?<mainboard_temperature>\d+)/) do |block|
			block.warning_serious(env, :mainboard_temperature, self)
		end
	end
end
